import pulpcore.Stage;
import pulpcore.image.CoreImage;
import pulpcore.sprite.ImageSprite;

/** Used to represent the branches that the players stand on before falling down onto the seesaw. */
public class Branch extends ImageSprite
{
	// TODO: Decide on branch height
	/** The height of the branch. */
	private static final int HEIGHT = 25;
	// TODO: Decide on branch width
	/** The width of the branch. */
	private static final int WIDTH = 250;
	/** The y anchor of the branch. */
	private static final double Y_ANCHOR = 0;

	/**
	 * Instantiates a new branch.
	 * 
	 * @param image
	 *            the image to be used as the branch
	 * @param xProportion
	 *            the proportion that the branch should be at horizontally
	 * @param yProportion
	 *            the proportion that the branch should be at vertically
	 */
	public Branch(final CoreImage image, final double xProportion, final double yProportion)
	{
		super(image, xProportion * Stage.getWidth(), yProportion * Stage.getHeight(), WIDTH, HEIGHT);
		setAnchor(xProportion, Y_ANCHOR);
	}

	/**
	 * Instantiates a new branch.
	 * 
	 * @param imageAsset
	 *            the file name of the image to be used as the branch
	 * @param xProportion
	 *            the proportion that the branch should be at horizontally
	 * @param yProportion
	 *            the proportion that the branch should be at vertically
	 */
	public Branch(final String imageAsset, final double xProportion, final double yProportion)
	{
		super(imageAsset, xProportion * Stage.getWidth(), yProportion * Stage.getHeight(), WIDTH, HEIGHT);
		setAnchor(xProportion, Y_ANCHOR);
	}
}